Skip to content

fix: Stop repo collaborators drifting on owner#3471

Merged
stevehipwell merged 4 commits into
integrations:mainfrom
stevehipwell:fix-repo-collaborators-drift
Jun 5, 2026
Merged

fix: Stop repo collaborators drifting on owner#3471
stevehipwell merged 4 commits into
integrations:mainfrom
stevehipwell:fix-repo-collaborators-drift

Conversation

@stevehipwell

Copy link
Copy Markdown
Collaborator

Resolves #3434


Before the change?

  • The github_repository_collaborators resource drifts when the rpo is personally and the owner hasn't been configured

After the change?

  • The github_repository_collaborators resource ignores the owner if no configured
  • Added owner_configured computed attribute to github_repository_collaborators resource

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@stevehipwell stevehipwell added this to the v6.13.0 milestone Jun 3, 2026
@stevehipwell stevehipwell requested a review from deiga June 3, 2026 17:56
@stevehipwell stevehipwell self-assigned this Jun 3, 2026
@stevehipwell stevehipwell added the Type: Bug Something isn't working as documented label Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

👋 Hi, and thank you for this contribution!

This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.

You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions.


🤖 This is an automated message.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

These provider review instructions are being used.
This PR aims to eliminate perpetual drift in github_repository_collaborators for personal repositories by ignoring the implicit repository owner collaborator when the owner isn’t configured, and introduces an owner_configured computed attribute to track that behavior.

Changes:

  • Adds an owner_configured computed attribute to the github_repository_collaborators schema and sets it during diffing.
  • Updates collaborator listing/reconciliation to optionally ignore the repository owner (to prevent owner-related drift on personal repos).
  • Adds acceptance tests for the personal-repo owner drift scenarios and updates the generated docs schema output.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
github/resource_github_repository_collaborators.go Adds owner_configured and uses an ignore list to filter the owner from collaborator reads/updates to prevent drift.
github/resource_github_repository_collaborators_test.go Adds acceptance coverage for personal repositories to validate owner drift behavior.
docs/resources/repository_collaborators.md Documents the new owner_configured read-only attribute in the generated schema section.

Comment thread github/resource_github_repository_collaborators.go
Comment thread github/resource_github_repository_collaborators_test.go
Comment thread github/resource_github_repository_collaborators_test.go
Comment thread docs/resources/repository_collaborators.md
Comment thread github/resource_github_repository_collaborators.go Outdated
Comment thread github/resource_github_repository_collaborators.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Comment thread .golangci.yml Outdated
Comment thread templates/resources/repository_collaborators.md.tmpl Outdated
Comment thread docs/resources/repository_collaborators.md Outdated
Comment thread github/resource_github_repository_collaborators.go
Comment thread github/resource_github_repository_collaborators.go
@stevehipwell stevehipwell force-pushed the fix-repo-collaborators-drift branch 2 times, most recently from 4cbaf51 to 19a9c60 Compare June 4, 2026 13:00
@stevehipwell stevehipwell requested a review from Copilot June 4, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread github/resource_github_repository_collaborators.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread github/resource_github_repository_collaborators.go
Comment thread github/resource_github_repository_collaborators.go
Comment thread github/resource_github_repository_collaborators.go
Comment thread github/resource_github_repository_collaborators_migration_test.go
@stevehipwell stevehipwell force-pushed the fix-repo-collaborators-drift branch from 15bef2c to 93b66b9 Compare June 5, 2026 12:03

@robert-crandall robert-crandall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking this one down @stevehipwell ! The state migration + NewValueKnown fallback is a really clean way to handle it.

@stevehipwell

Copy link
Copy Markdown
Collaborator Author

@deiga just waiting on you for the merge.

@stevehipwell stevehipwell force-pushed the fix-repo-collaborators-drift branch from 93b66b9 to 839ea7e Compare June 5, 2026 17:08
@stevehipwell stevehipwell merged commit cd39775 into integrations:main Jun 5, 2026
10 checks passed
@stevehipwell stevehipwell deleted the fix-repo-collaborators-drift branch June 5, 2026 18:28
austenstone pushed a commit to austenstone/terraform-provider-github that referenced this pull request Jun 9, 2026
* fix: Stop repo collaborators drifting on owner

Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>

* fixup! fix: Stop repo collaborators drifting on owner

* fixup! fix: Stop repo collaborators drifting on owner

* fixup! fix: Stop repo collaborators drifting on owner

---------

Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
austenstone added a commit to austenstone/terraform-provider-github that referenced this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working as documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS]: Behaviour change in 6.12.1 vs 6.11.1

4 participants